hey guys i have a question. So i have a class in nodejs and in the constructor i initialiuse a few smart contracts from uniswap. However i am making a function that takes in as a parameter on one the smart contratcs that i initialise in the constructor. however when I i try to call the method and pass in the uniswapFactoryContract as an arg called "echangeName", node takes this.exchangeName asit is, but instead of taking exchangeName as the arg i pass in it takes it as this.echangeName not this.TheNameOfTheArgIPassIn. My code is below could anyone help me or provide another way
module.exports =class Registry {
constructor() {
//default token addresses
this.DAI = "0x6b175474e89094c44da98b954eedeac495271d0f";
this.WETH = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
//default provided exhange addressses
this.UniswapFactoryAddress = "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f";
this.UniswapRouterAddress = "0xf164fC0Ec4E93095b804a4795bBe1e041497b92a";
}
//when i call this in index.js i specifcy the uniswapFactoryaddress as the exchange name paramrer
async getTokenPairSddress(addressToken0, addressToken1, exchangeName) {
//this line throws the error it thinks i want this.echange name instead of
//this.uniswapFactoryContract
const pairAddress = await this.exchangeName.methods.getPair(addressToken0, addressToken1).call();
return pairAddress;
}
}